<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<input id="userId" name="userId" type="hidden">

							<tr th:each="u:${list}">
								<div class="form-group" >
									<label class="col-sm-3 control-label"><span th:text="${u.gradeName}"></span></label>
									<div class="col-sm-3">
										人数:<input name="number"  class="form-control" type="text"
												   th:value="${u.number}">
									</div>
									<div class="col-sm-3">
										比例:<input name="proportion" class="form-control" type="text"
												   th:value="${u.proportion}">
									</div>
									<div class="col-sm-3">
											<button type="button" name="sub" th:value="${u.id}" class="btn btn-primary" >保存</button>
									</div>
								</div>

							</tr>

							<input type="hidden" name="roleIds" id="roleIds">

						</form>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div th:include="include::footer"></div>
	<!--<script type="text/javascript" src="/js/appjs/sys/user/add.js"></script>-->
	<script type="text/javascript" src="/js/appjs/sys/user/addUser.js"></script>
	<script>
        $("[name='sub']").click(function () {
            $.ajax({
                type: "POST",
                url: "/sys/mem/updateGrade",
                data: {id: $(this).val(),"number": $(this).parent().parent().find("input").eq(0).val(),"proportion": $(this).parent().parent().find("input").eq(1).val()},
                success: function (data) {
                    if (data.code == 0) {
                        layer.msg("保存成功");
                    }else{
                        layer.msg(data.msg);
					}
                }
            });
        })

	</script>
</body>
</html>
